<!DOCTYPE html>
<link href="__STATIC__/tax/css/base/jquery-ui-1.10.4.custom.min.css" rel="stylesheet">
<html>
    <meta charset="UTF-8">
    <title>口令</title>
<body>
<style type="text/css" media="all">
    body{
        margin: 0;
    }
    #key{
        width: 100vw;
        height: 100vh;
        top: 0;
        left: 0;
        overflow: hidden;
        background: url('/static/User/img/keybg.png') no-repeat;
        background-size: 100% 100%;
        box-sizing: border-box;
    }
    .top{
        top: 0;
        left: 0;
        width: 100%;
        display: flex;
        justify-content: flex-end;
        padding: 10px;
        box-sizing: border-box;
    }
    .top img{
        margin-left: 5px;
        width: 20px;
    }
    .close-sys{
        width: 20px;
    }
    .keybox{
        width: 437px;
        margin: 0 auto;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
    }
    .keybox .title{
        text-align: center;
        color: #fff;
        position: relative;
        font-size: 18px;
    }
    .show_box{
        color: #FFFF00;
        font-size: 12px;
        border-bottom: 1px solid;
        margin-left: 5px;
        cursor: pointer;
    }
    #getKey{
        background: #DAA864;
        color: #004285;
        outline: 0;
        border: 0;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;

         font-size: 22px;
        font-weight: bold;
    }
    #getKey img{
        width: 25px;
    }
    .inputbox{
        display: flex;
        width: 70%;
        margin: 20px auto;
        justify-content: space-between;
    }
    .inputbox input{
        height: 30px;
        width: calc(100% - 40px);
        background: #fff;
        outline: 0;
        border: 0;
        box-sizing: border-box;
        text-align: center;
    }

    .tips{
        text-align: center;
        font-size: 12px;
        color: #FFFF00;
        margin-top: 40px;
        top: 70%;
        left: 50%;
        width: 100%;
        position: absolute;
        transform: translate(-50%,-50%);
    }
    .system{
        display: none;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
        background: #fff;
        width: 75%;
        min-height: 172px;
        max-width: 437px;
    }
    .sys-tips{
        padding: 10px 5%;
        box-sizing: border-box;
        font-size: 14px;
        color: #777;
        text-indent: 2em;
        border-bottom: 1px solid #ccc;
        height: 100px;
    }
    .system .sys-title{
        display: flex;
        background: #165693;
        padding: 6px;
        box-sizing: border-box;
        justify-content: space-between;
        font-size: 14px;
        color: #fff;
    }
    .sys-btn{
        text-align: center;
        height: 40px;
        line-height: 40px;
    }
    .sys-btn button{
        background: #165B92;
        color: #fff;
        width: 80px;
        height: 30px;
        line-height: 30px;
        padding: 0;
        border: 0;
        outline: 0;
    }
    .check{
        color: #FFFF00;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;

    }
    .check input{
        margin-right: 10px;
    }
    .check label{
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        cursor: pointer;
    }
</style>
<div id="key">
    <div class="top">
         <img src="__STATIC__/tax/images/min-window.svg" id="min-window" alt=""/>
         <img src="__STATIC__/tax/images/close-window.svg" id="close-window" alt=""/>
    </div>
    <div class="keybox">
        <div class="title">
            <p>请输入设备口令<span class="show_box">什么是设备口令?</span></p>
        </div>
        <div class="inputbox">
            <input type="password" id="keyinput"  />
            <button id="getKey"><img src="__STATIC__/User/img/yjt.png" alt="" /></button>
        </div>
        <div class="check">
            <label >
                <input type="checkbox"  />
                <span>记住口令</span>
            </label>

        </div>
    </div>

    <div class="tips">
    </div>
    <div class="system">
        <div class="sys-title">
            <span>系统提示</span>
            <img src="__STATIC__/tax/images/close-window.svg" class="close-sys" alt=""/>
        </div>
        <div class="sys-tips">
            说明: 为简化操作，现将原税务UKey密码和原数字证书密码合并为设备口令。如您设置过原密码则设备口令为原税务UKey密码，如未设置则初始设备口令为12345678。
        </div>
        <div class="sys-btn">
            <button class="close-sys">确认</button>
        </div>
    </div>
</div>

{include file="public/foot"}
<!--<script src="__STATIC__/tax/js/jquery-ui-1.10.4.custom.min.js"></script>-->
 <script type="text/javascript" src=" /static/User/js/jquery-2.1.1.min.js "></script>
<!--<script src="/static/jsbridge-mini.js"></script>-->
<script src="/static/Admin/layer/layer.js"></script>
<script type="text/javascript" charset="utf-8">
    if (typeof jsBridge != "undefined"){
        jsBridge.setWindowSize({
            width: 437,
            height: 249,
            align:'center'
        }).then((res) => {
            if (res.success) {
                console.log('设置窗口大小成功');
            }
        });
    }

    $('#getKey').click(function(){
        let str = $('#keyinput').val()
        if(str == ''){
            $('.tips').html('税务UKey密码不能为空')
            return false
        }
        Qajax("{:url('password')}","post",{password:str},true).then(res=>{
            if(res.status == 1){
                $('.tips').html('')
                if (typeof jsBridge != "undefined"){
                    //跳转登录页
                    jsBridge.setWindowSize({
                        width: 1200,
                        height: 800,
                    }).then((res2) => {
                        if (res2.success) {
                            jsBridge.center();
                            window.location.href = res.url
                            console.log('设置窗口大小成功');
                        }
                    });
                }else {
                    window.location.href = res.url
                }


                //修改尺寸
                // if (typeof jsBridge != "undefined"){
                //     jsBridge.reload();
                // }else {
                //     //跳转登录页
                //     window.location.href = res.url
                // }


            }
        }).fail(err=>{
            $('.tips').html(err.message)
        })
    })
    $('.show_box').click(function(){
        $('.system').show()
    })
    $('.close-sys').click(function(){
        $('.system').hide()
    })
    $('#show_time').click(function () {
        $('.repair .time').show()
        $('.repair .numseg').hide()
    })
    $('#show_num').click(function () {
        $('.repair .time').hide()
        $('.repair .numseg').show()
    })

    $('#close-repair').click(function () {
        $('.repair').hide()
    })
    $("#min-window").click(function () {
        jsBridge.minimize().then((res) => {
            if (res.success) {
                console.log('最小化窗口成功');
            }
        });
    })
    $("#close-window").click(function(){
        jsBridge.exit();
    })
</script>
</body>
</html>
